<?php
namespace Home\Controller;
use Think\Controller;
class showproductController extends Controller {
    public function showproduct(){
        $nav=M('nav')->select();
        $this->assign('nav',$nav);
        $logo=M('config')->where("con_title='logo'")->find();
        $this->assign('logo',$logo);
        $icp=M('config')->where("con_title='备案号'")->find();
        $this->assign('icp',$icp);
    	if(I('get.pro_id')){
    		$pro_id=I('get.pro_id');
    		$showproduct=M('product')
    						->alias('a')
							->field('a.*,c.cat_name')
							->join("ft_cat_pro as c on a.cat_id=c.cat_id")
    						->where("a.pro_id=$pro_id")
    						->find();
    		$this->assign('showproduct',$showproduct);
    	}
    	$product=M('product')
    				->order('pro_addtime DESC')
    				->limit(6)
    				->select();
    	$this->assign('product',$product);
    	$this->display();
    }
}